#ifndef VIDEO_STREAM_CAPTURE_H
#define VIDEO_STREAM_CAPTURE_H

#include <QThread>
#include "video_device.h"
#include <QFile>
#include <xvid.h>
#include "xvidcodec.h"
#include <QTimer>
#include <QPainter>
#include "libmp4v2_interface.h"



class video_stream_capture : public QThread
{
    Q_OBJECT
public:
    explicit video_stream_capture(QObject *parent = 0);
    void run();
    ~video_stream_capture();
    video_device* vd;
    QImage process_frame;
    QImage watermark(QImage& image);
signals:
    void frame_changed();
public slots:

private:

    QFile* videoFile;
    unsigned char* mp4Buffer;
    XvidCodec* encoder;
     QTimer* refresh_timer;
     QTimer* second_timer;
     QString datetimestring;
    QByteArray sendbytes;
    jrtp_transmission rtpsender;
    libmp4v2_interface mp4interface;

  private slots:
     void save_video_file();
     void recordFrame();
     void second_timeout();

};

#endif // VIDEO_STREAM_CAPTURE_H
